package com.bingxue.edu.management.shop.model.entity;

import com.bingxue.edu.framework.common.model.BusinessEntity;
import com.bingxue.edu.management.education.model.entity.ClassInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单课程项实体
 *
 * @author panbo
 * @since 2024/08/27 14:27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table("shop_order_item")
public class OrderItem extends BusinessEntity {

    @Schema(description = "订单id")
    private String orderId;

    @Schema(description = "班级id")
    private String classId;

    @Schema(description = "学生id")
    private String studentId;

    @Schema(description = "班级名称")
    private String className;

    @Schema(description = "课次顺序id列表")
    @Column(typeHandler = JacksonTypeHandler.class)
    private List<Integer> lessonIndexes;

    @Schema(description = "总价")
    private BigDecimal actualTotalPrice;

    @Schema(description = "课单价")
    private BigDecimal actualUnitPrice;

    @Schema(description = "退费金额")
    private BigDecimal refundPrice;

    @JsonIgnore
    @Column(ignore = true)
    @Schema(description = "班级信息")
    private ClassInfo classInfo;
}
